#ifndef SCRIPTENTRY_H
#define SCRIPTENTRY_H

#include<QWidget>
#include<QHBoxLayout>
#include<QPushButton>
#include<QString>
#include<QLabel>

#include"ScriptEntryRaw.h"

class ScriptEntry: public QWidget{
Q_OBJECT
public:
	ScriptEntry(const QString &sql, const QString &comment, QWidget *parent);
	ScriptEntry(const QString &sql, const QString &comment, ScriptEntryRaw *script, QWidget *parent);
	~ScriptEntry();
    void init(const QString &comment);
	
	const QString &sql()const{ return m_sql; }
	ScriptEntryRaw *script()const{ return m_script; }
private:
	QHBoxLayout *m_layout;
	QLabel *m_label;
	QString m_sql;
	QPushButton *m_buttonDelete;
	QPushButton *m_buttonEdit;
	ScriptEntryRaw *m_script;
private slots:
	void slotDelete();
	void slotEdit();
signals:
	void deleteMe();
	void editMe();
};

#endif
